package com.bw.mvvm_comom.network;

import com.bw.mvvm_comom.network.inteceptor.SignInterceptor;

import okhttp3.OkHttpClient;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

public class SignImpl extends BaseImpl {
    Retrofit retrofit;
    @Override
    public Retrofit getRetrofit() {
        OkHttpClient.Builder builder = createOkhttpBuilder();
        builder.addInterceptor(new SignInterceptor());
        retrofit = new Retrofit.Builder()
                .baseUrl(Api.baseUrl)
                .client(builder.build())
                .addConverterFactory(GsonConverterFactory.create())
                .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
                .build();

        return retrofit;
    }
}
